package com.hertz.appr.util;

import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Date;

import javax.imageio.ImageIO;

import org.apache.commons.lang.time.DateUtils;
import org.springframework.web.util.HtmlUtils;
import org.xhtmlrenderer.simple.Graphics2DRenderer;
import org.xhtmlrenderer.swing.Java2DRenderer;
import org.xhtmlrenderer.util.FSImageWriter;

import com.hertz.appr.service.ActionService;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args)throws Exception {
		// TODO Auto-generated method stub
//		File f = new File("D:/out/html/19203033.html");
//		Java2DRenderer renderer = new Java2DRenderer(f, 1024);
//		renderer.setBufferedImageType(BufferedImage.TYPE_INT_RGB);
//		BufferedImage image = renderer.getImage();
//
//		FSImageWriter imageWriter = new FSImageWriter();
//		String path = f.getAbsolutePath();
//		path = path.substring(0, path.lastIndexOf("."));
//		imageWriter.write(image, path + ".png");
//
//		// compare to old
//		BufferedImage img = Graphics2DRenderer.renderToImageAutoSize(f.toURI().toURL().toExternalForm(), 1024, BufferedImage.TYPE_INT_ARGB);
//		ImageIO.write(img, "png", new File(path + "-G2DR.png"));
		DateUtils.parseDate("Tue Sep 07 12:50:46 +0800 2010", new String[]{"EEE MMM dd HH:mm:ss z yyyy"});
//		System.out.println(new Date("Tue Sep 07 12:50:46 +0800 2010"));
//		System.out.println(Util.parseDate("Tue Sep 07 12:50:46 +0800 2010", "EEE MMM dd HH:mm:ss z yyyy"));
	}

}
